/* 淡入淡出 */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

.fade-out {
    animation: fadeOut 0.3s ease-in-out;
}

/* 滑动 */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(100%);
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-100%);
    }
}

@keyframes slideInUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideOutUp {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(-100%);
    }
}

@keyframes slideInDown {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
    }
    to {
        transform: translateY(100%);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-in-out;
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in-out;
}

.slide-in-left {
    animation: slideInLeft 0.3s ease-in-out;
}

.slide-out-left {
    animation: slideOutLeft 0.3s ease-in-out;
}

.slide-in-up {
    animation: slideInUp 0.3s ease-in-out;
}

.slide-out-up {
    animation: slideOutUp 0.3s ease-in-out;
}

.slide-in-down {
    animation: slideInDown 0.3s ease-in-out;
}

.slide-out-down {
    animation: slideOutDown 0.3s ease-in-out;
}

/* 缩放 */
@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    50% {
        opacity: 1;
    }
}

@keyframes zoomOut {
    from {
        opacity: 1;
    }
    50% {
        opacity: 0;
        transform: scale3d(0.3, 0.3, 0.3);
    }
    to {
        opacity: 0;
    }
}

.zoom-in {
    animation: zoomIn 0.3s ease-in-out;
}

.zoom-out {
    animation: zoomOut 0.3s ease-in-out;
}

/* 旋转 */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate {
    animation: rotate 1s linear infinite;
}

/* 脉冲 */
@keyframes pulse {
    from {
        transform: scale3d(1, 1, 1);
    }
    50% {
        transform: scale3d(1.05, 1.05, 1.05);
    }
    to {
        transform: scale3d(1, 1, 1);
    }
}

.pulse {
    animation: pulse 1s ease-in-out infinite;
}

/* 摇晃 */
@keyframes shake {
    from,
    to {
        transform: translate3d(0, 0, 0);
    }
    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translate3d(-10px, 0, 0);
    }
    20%,
    40%,
    60%,
    80% {
        transform: translate3d(10px, 0, 0);
    }
}

.shake {
    animation: shake 0.82s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

/* 弹跳 */
@keyframes bounce {
    from,
    20%,
    53%,
    to {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translate3d(0, 0, 0);
    }
    40%,
    43% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -30px, 0) scaleY(1.1);
    }
    70% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -15px, 0) scaleY(1.05);
    }
    80% {
        transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translate3d(0, 0, 0) scaleY(0.95);
    }
    90% {
        transform: translate3d(0, -4px, 0) scaleY(1.02);
    }
}

.bounce {
    animation: bounce 1s ease infinite;
}

/* 闪烁 */
@keyframes flash {
    from,
    50%,
    to {
        opacity: 1;
    }
    25%,
    75% {
        opacity: 0;
    }
}

.flash {
    animation: flash 1s ease infinite;
}

/* 进度条加载 */
@keyframes progress {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

.progress {
    animation: progress 2s linear;
}

/* 动画工具类 */
.animated {
    animation-duration: 1s;
    animation-fill-mode: both;
}

.animated.infinite {
    animation-iteration-count: infinite;
}

.animated.fast {
    animation-duration: 0.5s;
}

.animated.slow {
    animation-duration: 2s;
}

.animated.delay-1s {
    animation-delay: 1s;
}

.animated.delay-2s {
    animation-delay: 2s;
}

.animated.delay-3s {
    animation-delay: 3s;
}

/* 暂停动画 */
.animated.paused {
    animation-play-state: paused;
}

/* 动画减速偏好 */
@media (prefers-reduced-motion: reduce) {
    .animated {
        animation: none !important;
        transition: none !important;
    }
} 